<button (click)="openModal()" class="wayne-button primary"
        *ngIf="authService.currentAppPermission.secret.create || authService.currentUser.admin">
  {{'SECRET.CREATE' | translate}}
</button>
<create-edit-secret (create)="createSecret($event)"></create-edit-secret>
<div *ngIf="secretId && secrets?.length>0">
  <wayne-tabs>
    <wayne-tab (click)="tabClick(secret.id)"
               [id]="secret.id"
               *ngFor="let secret of secrets"
               [active]="secret.id==secretId"
               [description]="secret.description"
    >
      {{secret.name}}
    </wayne-tab>
  </wayne-tabs>
  <div class="table-search">
    <div class="table-search-left">
      <button (click)="createSecretTpl()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.secret.create || authService.currentUser.admin">
        {{'SECRET.CREATE_TMP' | translate}}
      </button>
      <button (click)="editSecret()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.secret.update || authService.currentUser.admin">
        {{'SECRET.EDIT' | translate}}
      </button>
      <button (click)="publishHistory()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.secret.read || authService.currentUser.admin">
        {{'BUTTON.HISTORY' | translate}}
      </button>
      <button (click)="deleteSecret()" class="wayne-button normal"
              *ngIf="authService.currentAppPermission.secret.delete || authService.currentUser.admin">
        {{'SECRET.DELETE' | translate}}
      </button>
      <button class="wayne-button normal" (click)="diffTpl()">{{'BUTTON.COMPARE_TEMPLATES' | translate}}</button>
      <wayne-filter-box (confirm)="confirmEvent()" (cancel)="cancelEvent()">
        <wayne-checkbox-group [(ngModel)]="showList">
          <wayne-checkbox value="create_time">{{'TITLE.CREATE_TIME' | translate}}</wayne-checkbox>
          <wayne-checkbox value="config_cluster">{{'TITLE.CONFIG_CLUSTER' | translate}}</wayne-checkbox>
          <wayne-checkbox value="online_cluster">{{'TITLE.ONLINE_CLUSTER' | translate}}</wayne-checkbox>
          <wayne-checkbox value="release_explain">{{'TITLE.RELEASE_EXPLAIN' | translate}}</wayne-checkbox>
          <wayne-checkbox value="create_user">{{'TITLE.CREATE_USER' | translate}}</wayne-checkbox>
          <wayne-checkbox value="action">{{'TITLE.ACTION' | translate}}</wayne-checkbox>
        </wayne-checkbox-group>
      </wayne-filter-box>
    </div>
    <div class="table-search-right">
      <div class="clr-toggle-wrapper">
        <input type="checkbox" id="search-online" [(ngModel)]="isOnline" name="toggle-basic" class="clr-toggle" (change)="onlineChange()">
        <label for="search-online">{{'MESSAGE.ONLY_ONLINE_TEMPLATE' | translate}}</label>
      </div>
    </div>
  </div>
  <list-secret [secrets]="secrets"
               (cloneTpl)="cloneSecretTpl($event)"
               [secretTpls]="secretTpls"
               (edit)="editSecret()"
               (paginate)="retrieve($event)"
               [appId]="appId"
               [showState]="showState"
               [page]="pageState.page"></list-secret>
</div>

